🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / takserver / src / commonMain / kotlin / org / meshtastic / core / takserver / XmlUtils.kt
Displaying Raw • Download
core/takserver/src/commonMain/kotlin/org/meshtastic/core/takserver/XmlUtils.kt b4bedd92fcc8d65daff79200d71f6ebc3d8f0cfa (b4bedd92) Text, 1.56 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.takserver
T8b949e/** Escapes XML special characters in attribute values and text content. */
Tff7b72internal Tff7b72fun Te6edf3StringTb4b4b4.Td2a8ffxmlEscapedTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657String Tff7b72=
Te6edf3replaceTb4b4b4(Ta5d6ff"Ta5d6ff&Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff&Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff"Ta5d6ff<Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff<Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff"Ta5d6ff>Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff>Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff"Ta5d6ff\"Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff"Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3replaceTb4b4b4(Ta5d6ff"Ta5d6ff'Ta5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff'Ta5d6ff"Tb4b4b4)
T8b949e/**
* Extracts the sender UID from a GeoChat-format UID string ("GeoChat.<senderUid>.<chatroom>.<messageId>"). Returns the
* original string unchanged for non-GeoChat UIDs.
*/
Tff7b72internal Tff7b72fun Te6edf3StringTb4b4b4.Td2a8ffgeoChatSenderUidTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657String Tff7b72= Tff7b72if Tb4b4b4(Te6edf3startsWithTb4b4b4(Ta5d6ff"Ta5d6ffGeoChat.Ta5d6ff"Tb4b4b4)Tb4b4b4) Te6edf3splitTb4b4b4(Ta5d6ff"Ta5d6ff.Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3getOrElseTb4b4b4(T79c0ff1Tb4b4b4) Tb4b4b4{ Ta5d6ff"Ta5d6ff" Tb4b4b4} Tff7b72else Tff7b72this
T8b949e/**
* Extracts the message ID from a GeoChat-format UID string ("GeoChat.<senderUid>.<chatroom>.<messageId>"). Returns the
* original string unchanged for non-GeoChat UIDs.
*/
Tff7b72internal Tff7b72fun Te6edf3StringTb4b4b4.Td2a8ffgeoChatMessageIdTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657String Tff7b72= Tff7b72if Tb4b4b4(Te6edf3startsWithTb4b4b4(Ta5d6ff"Ta5d6ffGeoChat.Ta5d6ff"Tb4b4b4)Tb4b4b4) Te6edf3splitTb4b4b4(Ta5d6ff"Ta5d6ff.Ta5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3lastOrNullTb4b4b4(Tb4b4b4) Tff7b72?: Tff7b72this Tff7b72else Tff7b72this
Served by rngit 1.5.0 - Generated in 0.09s